import http from './http.js'

// 列表
const categories = (pageNumber,pageSize,categoryLevel,parentId) => {
  return http.get('/categories',{
    params:{
      pageNumber,
      pageSize,
      categoryLevel,
      parentId
    }
  })
}

// 新增
const categoriesAdd = (categoryLevel,categoryName,categoryRank,parentId) => {
  return http.post('/categories',{
    categoryLevel,
    categoryName,
    categoryRank,
    parentId
  })
}

// 获取单条数据
const categoriesInfo = (id) => {
  return http.get(`/categories/${id}`)
}
export default{
  categories,
  categoriesAdd,
  categoriesInfo
}